home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- import unittest
- import util
- import struct
-
- class UtilTestingSuite(unittest.TestCase):
-
- def testUnpackNames(self):
- testdata = struct.pack('!HIB', 1, 0xFA0L, 3) + 'some extraneous data'
- magic_hash = util.unpack_named('!HIBR', 'one', 'four thousand long', 'three', 'extra', testdata)
- self.assertEquals(magic_hash['extra'], 'some extraneous data')
-
-
- def testStorage(self):
- s = util.Storage({
- 'key': 'value' })
- self.assertEquals(s.key, 'value')
-
-
- def testdocs(self):
- import doctest
- doctest.testmod(util)
-
-
- def testBaseClasses(self):
-
- class Shape(object):
- pass
-
-
- class Rectangle(Shape):
- pass
-
-
- class Square(Rectangle):
- pass
-
- self.assertEqual(set(util.baseclasses(Square)), set([
- Rectangle,
- Shape,
- object]))
-
-
- if __name__ == '__main__':
- unittest.main()
-
-